home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / TableCellRenderer.java < prev    next >
Text File  |  1998-06-30  |  2KB  |  59 lines

  1. /*
  2.  * @(#)TableCellRenderer.java    1.9 98/01/30
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package com.sun.java.swing.table;
  22.  
  23. import java.awt.Component;
  24. import com.sun.java.swing.*;
  25.  
  26. /**
  27.  * This interface defines the methods any object that would like to be
  28.  * a renderer for cell in a JTable.
  29.  *
  30.  * @version 1.9 01/30/98
  31.  * @author Alan Chung
  32.  */
  33.  
  34. public interface TableCellRenderer {
  35.  
  36.     /**
  37.      *  This method is sent to the renderer by the drawing table to
  38.      *  configure the renderer appropriately before drawing.  Return
  39.      *  the Component used for drawing.
  40.      *
  41.      * @param    table        the JTable that is asking the renderer to draw.
  42.      *                This parameter can be null.
  43.      * @param    value        the value of the cell to be rendered.  It is
  44.      *                up to the specific renderer to interpret
  45.      *                and draw the value.  eg. if value is the
  46.      *                String "true", it could be rendered as a
  47.      *                string or it could be rendered as a check
  48.      *                box that is checked.  null is a valid value.
  49.      * @param    isSelected    true is the cell is to be renderer with
  50.      *                selection highlighting
  51.      * @param    row            the row index of the cell being drawn.  When
  52.      *                drawing the header the rowIndex is -1.
  53.      * @param    column            the column index of the cell being drawn
  54.      */
  55.     Component getTableCellRendererComponent(JTable table, Object value,
  56.                         boolean isSelected, boolean hasFocus, 
  57.                         int row, int column);
  58. }
  59.